﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="MusicAcademyDataSet2" targetNamespace="http://tempuri.org/MusicAcademyDataSet2.xsd" xmlns:mstns="http://tempuri.org/MusicAcademyDataSet2.xsd" xmlns="http://tempuri.org/MusicAcademyDataSet2.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="MusicAcademyConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="MusicAcademyConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.MusicAcademy.Properties.Settings.GlobalReference.Default.MusicAcademyConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="FullTermTableAdapter" GeneratorDataComponentClassName="FullTermTableAdapter" Name="FullTerm" UserDataComponentName="FullTermTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="MusicAcademyConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT     Term.ID, Person.firstName, Person.lastName, Term.startDate, Term.days, Term.cost, Term.teacherPercent, Term.teacherID, Term.toolID, Term.isGroup, Term.teachingTime, 
                      Tool.toolName, Term.academyID, Term.creator, Term.createDate, Term.lastEditor, Term.editDate, Term.enable
FROM         Term INNER JOIN
                      Tool ON Term.toolID = Tool.ID INNER JOIN
                      Person ON Term.teacherID = Person.ID
WHERE        (Person.firstName + N' ' + Person.lastName LIKE N'%' + @teacherName + N'%' OR @teacherName=N'') AND (Tool.toolName LIKE N'%' + @toolName + N'%' OR @toolName=N'') AND (enable=@enable OR @enable=-1) AND (Tool.academyID = @academyID) 
ORDER BY enable DESC, Term.ID DESC</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="teacherName" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="String" Direction="Input" ParameterName="@teacherName" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="toolName" ColumnName="toolName" DataSourceName="MusicAcademy.dbo.Tool" DataTypeServer="nvarchar(50)" DbType="String" Direction="Input" ParameterName="@toolName" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumn="toolName" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="enable" ColumnName="enable" DataSourceName="MusicAcademy.dbo.Term" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@enable" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="enable" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="academyID" ColumnName="academyID" DataSourceName="MusicAcademy.dbo.Tool" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@academyID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="academyID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="firstName" DataSetColumn="firstName" />
              <Mapping SourceColumn="lastName" DataSetColumn="lastName" />
              <Mapping SourceColumn="startDate" DataSetColumn="startDate" />
              <Mapping SourceColumn="days" DataSetColumn="days" />
              <Mapping SourceColumn="cost" DataSetColumn="cost" />
              <Mapping SourceColumn="teacherPercent" DataSetColumn="teacherPercent" />
              <Mapping SourceColumn="toolName" DataSetColumn="toolName" />
              <Mapping SourceColumn="academyID" DataSetColumn="academyID" />
              <Mapping SourceColumn="creator" DataSetColumn="creator" />
              <Mapping SourceColumn="createDate" DataSetColumn="createDate" />
              <Mapping SourceColumn="lastEditor" DataSetColumn="lastEditor" />
              <Mapping SourceColumn="editDate" DataSetColumn="editDate" />
              <Mapping SourceColumn="teachingTime" DataSetColumn="teachingTime" />
              <Mapping SourceColumn="teacherID" DataSetColumn="teacherID" />
              <Mapping SourceColumn="toolID" DataSetColumn="toolID" />
              <Mapping SourceColumn="isGroup" DataSetColumn="isGroup" />
              <Mapping SourceColumn="ID" DataSetColumn="ID" />
              <Mapping SourceColumn="enable" DataSetColumn="enable" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="MusicAcademyConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="FillByStarting" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByStarting" GeneratorSourceName="FillByStarting" GetMethodModifier="Public" GetMethodName="GetDataByStarting" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByStarting" UserSourceName="FillByStarting">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT     Term.ID, Person.firstName, Person.lastName, Term.startDate, Term.days, Term.cost, Term.teacherPercent, Term.teacherID, Term.toolID, Term.isGroup, Term.teachingTime, 
                      Tool.toolName, Term.academyID, Term.creator, Term.createDate, Term.lastEditor, Term.editDate, Term.enable
FROM         Term INNER JOIN
                      Tool ON Term.toolID = Tool.ID INNER JOIN
                      Person ON Term.teacherID = Person.ID
WHERE        (Person.firstName + N' ' + Person.lastName LIKE @teacherName + N'%' OR @teacherName=N'') AND (Tool.toolName LIKE @toolName + N'%' OR @toolName=N'') AND (enable=@enable OR @enable=-1) AND (Tool.academyID = @academyID) 
ORDER BY Term.ID DESC</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="teacherName" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="String" Direction="Input" ParameterName="@teacherName" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="toolName" ColumnName="toolName" DataSourceName="MusicAcademy.dbo.Tool" DataTypeServer="nvarchar(50)" DbType="String" Direction="Input" ParameterName="@toolName" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumn="toolName" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="enable" ColumnName="enable" DataSourceName="MusicAcademy.dbo.Term" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@enable" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="enable" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="academyID" ColumnName="academyID" DataSourceName="MusicAcademy.dbo.Tool" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@academyID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="academyID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="WeekDaysTableAdapter" GeneratorDataComponentClassName="WeekDaysTableAdapter" Name="WeekDays" UserDataComponentName="WeekDaysTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="MusicAcademyConnectionString (Settings)" DbObjectName="MusicAcademy.dbo.WeekDays" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[WeekDays] WHERE (([ID] = @Original_ID) AND ([dayName] = @Original_dayName))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Byte" Direction="Input" ParameterName="@Original_ID" Precision="0" ProviderType="TinyInt" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_dayName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="dayName" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[WeekDays] ([ID], [dayName]) VALUES (@ID, @dayName);
SELECT ID, dayName FROM WeekDays WHERE (ID = @ID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Byte" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="TinyInt" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@dayName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="dayName" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>SELECT ID, dayName FROM dbo.WeekDays</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[WeekDays] SET [ID] = @ID, [dayName] = @dayName WHERE (([ID] = @Original_ID) AND ([dayName] = @Original_dayName));
SELECT ID, dayName FROM WeekDays WHERE (ID = @ID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Byte" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="TinyInt" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@dayName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="dayName" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Byte" Direction="Input" ParameterName="@Original_ID" Precision="0" ProviderType="TinyInt" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_dayName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="dayName" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="ID" DataSetColumn="ID" />
              <Mapping SourceColumn="dayName" DataSetColumn="dayName" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="MusicAcademyDataSet2" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="MusicAcademyDataSet2" msprop:Generator_UserDSName="MusicAcademyDataSet2">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="FullTerm" msprop:Generator_TableClassName="FullTermDataTable" msprop:Generator_TableVarName="tableFullTerm" msprop:Generator_RowChangedName="FullTermRowChanged" msprop:Generator_TablePropName="FullTerm" msprop:Generator_RowDeletingName="FullTermRowDeleting" msprop:Generator_RowChangingName="FullTermRowChanging" msprop:Generator_RowEvHandlerName="FullTermRowChangeEventHandler" msprop:Generator_RowDeletedName="FullTermRowDeleted" msprop:Generator_RowClassName="FullTermRow" msprop:Generator_UserTableName="FullTerm" msprop:Generator_RowEvArgName="FullTermRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="firstName" msprop:Generator_ColumnVarNameInTable="columnfirstName" msprop:Generator_ColumnPropNameInRow="firstName" msprop:Generator_ColumnPropNameInTable="firstNameColumn" msprop:Generator_UserColumnName="firstName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="30" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="lastName" msprop:Generator_ColumnVarNameInTable="columnlastName" msprop:Generator_ColumnPropNameInRow="lastName" msprop:Generator_ColumnPropNameInTable="lastNameColumn" msprop:Generator_UserColumnName="lastName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="30" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="startDate" msprop:Generator_ColumnVarNameInTable="columnstartDate" msprop:Generator_ColumnPropNameInRow="startDate" msprop:Generator_ColumnPropNameInTable="startDateColumn" msprop:Generator_UserColumnName="startDate">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="days" msprop:Generator_ColumnVarNameInTable="columndays" msprop:Generator_ColumnPropNameInRow="days" msprop:Generator_ColumnPropNameInTable="daysColumn" msprop:Generator_UserColumnName="days" type="xs:int" />
              <xs:element name="cost" msprop:Generator_ColumnVarNameInTable="columncost" msprop:Generator_ColumnPropNameInRow="cost" msprop:Generator_ColumnPropNameInTable="costColumn" msprop:Generator_UserColumnName="cost" type="xs:long" />
              <xs:element name="teacherPercent" msprop:Generator_ColumnVarNameInTable="columnteacherPercent" msprop:Generator_ColumnPropNameInRow="teacherPercent" msprop:Generator_ColumnPropNameInTable="teacherPercentColumn" msprop:Generator_UserColumnName="teacherPercent" type="xs:double" />
              <xs:element name="toolName" msprop:Generator_ColumnVarNameInTable="columntoolName" msprop:Generator_ColumnPropNameInRow="toolName" msprop:Generator_ColumnPropNameInTable="toolNameColumn" msprop:Generator_UserColumnName="toolName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="academyID" msprop:Generator_ColumnVarNameInTable="columnacademyID" msprop:Generator_ColumnPropNameInRow="academyID" msprop:Generator_ColumnPropNameInTable="academyIDColumn" msprop:Generator_UserColumnName="academyID" type="xs:int" />
              <xs:element name="creator" msprop:Generator_ColumnVarNameInTable="columncreator" msprop:Generator_ColumnPropNameInRow="creator" msprop:Generator_ColumnPropNameInTable="creatorColumn" msprop:Generator_UserColumnName="creator" type="xs:long" />
              <xs:element name="createDate" msprop:Generator_ColumnVarNameInTable="columncreateDate" msprop:Generator_ColumnPropNameInRow="createDate" msprop:Generator_ColumnPropNameInTable="createDateColumn" msprop:Generator_UserColumnName="createDate">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="lastEditor" msprop:Generator_ColumnVarNameInTable="columnlastEditor" msprop:Generator_ColumnPropNameInRow="lastEditor" msprop:Generator_ColumnPropNameInTable="lastEditorColumn" msprop:Generator_UserColumnName="lastEditor" type="xs:long" minOccurs="0" />
              <xs:element name="editDate" msprop:Generator_ColumnVarNameInTable="columneditDate" msprop:Generator_ColumnPropNameInRow="editDate" msprop:Generator_ColumnPropNameInTable="editDateColumn" msprop:Generator_UserColumnName="editDate" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="teachingTime" msprop:Generator_ColumnVarNameInTable="columnteachingTime" msprop:Generator_ColumnPropNameInRow="teachingTime" msprop:Generator_ColumnPropNameInTable="teachingTimeColumn" msprop:Generator_UserColumnName="teachingTime" type="xs:int" />
              <xs:element name="teacherID" msprop:Generator_ColumnVarNameInTable="columnteacherID" msprop:Generator_ColumnPropNameInRow="teacherID" msprop:Generator_ColumnPropNameInTable="teacherIDColumn" msprop:Generator_UserColumnName="teacherID" type="xs:long" />
              <xs:element name="toolID" msprop:Generator_ColumnVarNameInTable="columntoolID" msprop:Generator_ColumnPropNameInRow="toolID" msprop:Generator_ColumnPropNameInTable="toolIDColumn" msprop:Generator_UserColumnName="toolID" type="xs:long" />
              <xs:element name="isGroup" msprop:Generator_ColumnVarNameInTable="columnisGroup" msprop:Generator_ColumnPropNameInRow="isGroup" msprop:Generator_ColumnPropNameInTable="isGroupColumn" msprop:Generator_UserColumnName="isGroup" type="xs:int" />
              <xs:element name="ID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" msprop:Generator_UserColumnName="ID" type="xs:long" />
              <xs:element name="enable" msprop:Generator_ColumnVarNameInTable="columnenable" msprop:Generator_ColumnPropNameInRow="enable" msprop:Generator_ColumnPropNameInTable="enableColumn" msprop:Generator_UserColumnName="enable" type="xs:int" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="WeekDays" msprop:Generator_TableClassName="WeekDaysDataTable" msprop:Generator_TableVarName="tableWeekDays" msprop:Generator_RowChangedName="WeekDaysRowChanged" msprop:Generator_TablePropName="WeekDays" msprop:Generator_RowDeletingName="WeekDaysRowDeleting" msprop:Generator_RowChangingName="WeekDaysRowChanging" msprop:Generator_RowEvHandlerName="WeekDaysRowChangeEventHandler" msprop:Generator_RowDeletedName="WeekDaysRowDeleted" msprop:Generator_RowClassName="WeekDaysRow" msprop:Generator_UserTableName="WeekDays" msprop:Generator_RowEvArgName="WeekDaysRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" msprop:Generator_UserColumnName="ID" type="xs:unsignedByte" />
              <xs:element name="dayName" msprop:Generator_ColumnVarNameInTable="columndayName" msprop:Generator_ColumnPropNameInRow="dayName" msprop:Generator_ColumnPropNameInTable="dayNameColumn" msprop:Generator_UserColumnName="dayName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:FullTerm" />
      <xs:field xpath="mstns:ID" />
    </xs:unique>
    <xs:unique name="WeekDays_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:WeekDays" />
      <xs:field xpath="mstns:ID" />
    </xs:unique>
  </xs:element>
</xs:schema>